import request from '@/utils/request'

export function getOrgList(params) {
  return request({
    url: '/api/organizations',
    method: 'GET',
    params
  })
}

export function createOrg(org) {
  return request({
    url: '/api/organizations',
    method: 'POST',
    data: org
  })
}

export function updateOrg(org) {
  return request({
    url: '/api/organizations/' + org.id,
    method: 'PUT',
    data: org
  })
}

export function deleteOrg(id) {
  return request({
    url: '/api/organizations/' + id,
    method: 'DELETE'
  })
}

export function getUserListOfOrg(orgId) {
  orgId = orgId || ''
  return request({
    url: '/api/users?f_eq_orgId=' + orgId,
    method: 'GET'
  })
}
